﻿using Prism.Commands;
using Prism.Modularity;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfApp_PrismModule.ViewModels;

public class MainWindowViewModel
{
    public DelegateCommand<string>? NaviViewCommand { get; set; }

    public MainWindowViewModel(IRegionManager regionManager,IModuleManager moduleManager)
    {
        NaviViewCommand = new DelegateCommand<string>(args =>
        {
            if (args == "ViewC")
            {
                moduleManager.LoadModule("ModuleC");
            }
                regionManager.RequestNavigate("mainRegion", args);
        });
    }
}
